#! /bin/sh

#########################################################################
# Script to report which network backend is in use
# (Linux bridge or Open vSwitch)
# 
# Usage:
#   xe-get-network-backend
#
# Output:
#   "bridge"      - Linux bridge in use
#   "openvswitch" - Open vSwitch in use
#########################################################################

set -e

backend=$(cat /etc/xensource/network.conf)

case "$backend" in
    bridge|openvswitch)
	;;
    vswitch)
	backend=openvswitch
	;;
    *)
	echo "Invalid network backend: $backend" >&2
	exit 1
	;;
esac

echo $backend
